﻿#if NET461 ||NET45
using TuesPechkin;
using System.Drawing.Printing;
using static TuesPechkin.GlobalSettings;
#else
using DinkToPdf;
#endif
using System;
using System.Collections.Generic;
using System.Text;

namespace JESAI.HtmlTemplate.Pdf
{
    public class PdfExportAttribute:Attribute
    {
#if !NET461 &&!NET45
        /// <summary>
        ///     方向
        /// </summary>
        public Orientation Orientation { get; set; } = Orientation.Landscape;
#else
        /// <summary>
        ///     方向
        /// </summary>
        public PaperOrientation Orientation { get; set; } = PaperOrientation.Portrait;
#endif

        /// <summary>
        ///     纸张类型（默认A4，必须）
        /// </summary>
        public PaperKind PaperKind { get; set; } = PaperKind.A4;
        /// <summary>
        /// 纸张宽度
        /// </summary>
        public int PaperWidth { get; set; }
        /// <summary>
        /// 纸张高度
        /// </summary>
        public int PaperHeight { get; set; }
        /// <summary>
        ///     是否启用分页数
        /// </summary>
        public bool IsEnablePagesCount { get; set; }

        /// <summary>
        ///     头部设置
        /// </summary>
        public HeaderSettings HeaderSettings { get; set; }

        /// <summary>
        ///     底部设置
        /// </summary>
        public FooterSettings FooterSettings { get; set; }
        /// <summary>
        ///     名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 服务器是否保存一份
        /// </summary>
        public bool IsEnableSaveFile { get; set; } = false;
            /// <summary>
            /// 保存路径
            /// </summary>
        public string SaveFileRootPath { get; set; } = "D:\\PdfFile";
        /// <summary>
        /// 是否缓存
        /// </summary>
        public bool IsEnableCache { get; set; } = false;
        /// <summary>
        /// 缓存有效时间
        /// </summary>
        public TimeSpan CacheTimeSpan { get; set; } = TimeSpan.FromMinutes(30);
    }
}
